from django.conf.urls import url

from . import views

urlpatterns = [
    # 提取url参数数据，位置参数
    url(r'^weather1/([a-z]+)/(\d{4})/$', views.weather1),

    url(r'^weather2/([a-z]+)/(\d{4})/$', views.weather2),

    url(r'^weather3/(?P<city>[a-z]+)/(?P<year>\d{4})/$', views.weather3),
    # 提取问号后⾯面的查询字符串
    url(r'^weather4/(?P<city>[a-z]+)/(?P<year>\d{4})/$', views.weather4),
    # 获取请求体中表单数据
    url(r'^get_body/$', views.get_body),
    # 获取请求体中非表单类型json数据
    url(r'^get_body_json/$', views.get_body_json),
    # 响应对象
    url(r'^response_demo/$', views.response_demo),
    # 响应json数据
    url(r'^json_response_demo/$', views.json_response_demo, name="index"),
    # 重定向及反向解析
    url(r'^redirect_demo/$', views.redirect_demo),
    # cookie读写
    url(r'^cookie_demo/$', views.cookie_demo),
    # session读写
    url(r'^session_demo/$', views.session_demo),

]